﻿@model Epi.Web.MVC.Models.FormModel
@{
    ViewBag.Title = "Epi Info™ Web Enter - Home"; //+ " - " +
    // Model.SurveyName + " - " + Model.IsDraftModeStyleClass + " - Mobile";
}

<script type="text/javascript">
    var redirectTimeout = @FormsAuthentication.Timeout.TotalMilliseconds
    var redirectTimeoutHandle = setTimeout(function() { window.location.href = '@FormsAuthentication.LoginUrl'; }, redirectTimeout);
</script>

<script>

    $(function () {

        $("#dropdown-1").change(function () {
            FilterRecords(this);

            // $("#right").hide();
            // $("button[class*='metro-tile']").removeClass('metro-set');
            //$("button:visible").triggerHandler('click');
        });


        //$("button:visible").triggerHandler('click');

    });
    $(document).ready(function () {

        // alert('@Model.OrganizationList[0].OrganizationId');
        FilterRecordsByOrgMobile('@Model.OrganizationList[0].OrganizationId');

    });
    function FilterFormRecords(ctrl)
    {
        var src = $(ctrl).val();
        FilterRecordsByOrgMobile(src);
    }
</script>

<style>
    #leftarrangeby .ui-select {
        display: inline-block !important;
    }

        #leftarrangeby .ui-select:nth-of-type(1) {
            width: 51%;
            max-width: 300px;
        }

        #leftarrangeby .ui-select:nth-of-type(2) {
            width: 45%;
            max-width: 220px;
        }
</style>
<script>
    $(document).ready(function () {
        $('#login-trigger').click(function () {
            $(this).next('#login-content').slideToggle();
            $(this).toggleClass('active');

            if ($(this).hasClass('active')) $(this).find('span').html('&#x25B2;')
            else $(this).find('span').html('&#x25BC;')
        })
    });
</script>


<div id="userwelcome">
    <nav>
        <ul>
            <li id="login">
                <a id="login-trigger" href="#">
                    <img src="~/Content/images/user12b.png" style="width: 16px; vertical-align: text-top; margin-top: 4px;"/> <span>▼</span>
                </a>
                <div id="login-content">
                    @Session["UserFirstName"]<br/>
                    @Html.ActionLink("Log Out", "LogOut", "Home", null, null)
                </div>
            </li>

        </ul>
    </nav>
    @*Welcome <strong>@Session["UserFirstName"]&nbsp; @Session["UserLastName"]</strong>&nbsp; | &nbsp;
    @Html.ActionLink("Log Out", "LogOut", "Home", null, null)*@
</div>

<div style="clear:both;"></div>

<div id="content" style="margin:0 0 200px 0 !important; padding:0 !important;">
    <div id="leftarrangeby" style="vertical-align:middle; font-size:10pt !important; margin-top:15px; display:none;">
        <select name="dropdown-2" style="vertical-align:middle; font-size:10pt !important; display:inline-block;" data-theme="submit2" onchange="FilterFormRecords(this);">
            @* <option value="0" selected="selected" disabled="disabled">Arrange by:</option>*@
            @foreach (var item in Model.OrganizationList)
            {
                <option value="@item.OrganizationId">@item.Organization</option>
            }

            @*	<option value="3">Last Saved Forms First</option>*@
        </select>

        <select name="dropdown-1" style="vertical-align:middle; font-size:10pt !important; display:inline-block;" data-theme="submit2" onchange="FilterRecords(this,$('#dropdown-2').val());">
            @* <option value="0" selected="selected" disabled="disabled">Arrange by:</option>*@
            <option value="1">My Forms</option>
            <option value="2">Forms Assigned to Me</option>
            <option value="3" selected="selected">All Forms</option>
        </select>

    </div>
    <div style="clear:both;"></div>


    @using (Html.BeginForm("Index", "FormResponse", FormMethod.Get, new { id = "form" }))
    {
        <div class="section group" id="main">
            <div>
                @Html.Partial("ListForms", Model.FormList)
            </div>
        </div>        
    }
    
</div>







@{if (ViewBag.Omniture.IsEnabled == true)
{
    Html.RenderPartial("OmniturePartial");
}
}
